package com.itrustsolution.rms.entities;
// Generated 25 Mei 11 22:19:57 by Hibernate Tools 3.2.1.GA


import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * RmsClientDept generated by hbm2java
 */
@Entity
@Table(name="rms_client_dept"
    ,catalog="rms"
)
public class RmsClientDept  implements java.io.Serializable {


     private Integer clientDeptId;
     private RmsClient rmsClient;
     private String clientDeptCode;
     private String clientDeptName;
     private boolean clientDeptIsactive;
     private boolean clientDeptIsdeleted;
     private Date clientDeptCreateDate;
     private int clientDeptCreateBy;
     private Set<RmsUser> rmsUsers = new HashSet(0);
     private Set<RmsProduct> rmsProducts = new HashSet(0);

    public RmsClientDept() {
    }

	
    public RmsClientDept(RmsClient rmsClient, String clientDeptCode, String clientDeptName, boolean clientDeptIsactive, boolean clientDeptIsdeleted, Date clientDeptCreateDate, int clientDeptCreateBy) {
        this.rmsClient = rmsClient;
        this.clientDeptCode = clientDeptCode;
        this.clientDeptName = clientDeptName;
        this.clientDeptIsactive = clientDeptIsactive;
        this.clientDeptIsdeleted = clientDeptIsdeleted;
        this.clientDeptCreateDate = clientDeptCreateDate;
        this.clientDeptCreateBy = clientDeptCreateBy;
    }
    public RmsClientDept(RmsClient rmsClient, String clientDeptCode, String clientDeptName, boolean clientDeptIsactive, boolean clientDeptIsdeleted, Date clientDeptCreateDate, int clientDeptCreateBy, Set rmsUsers, Set rmsProducts) {
       this.rmsClient = rmsClient;
       this.clientDeptCode = clientDeptCode;
       this.clientDeptName = clientDeptName;
       this.clientDeptIsactive = clientDeptIsactive;
       this.clientDeptIsdeleted = clientDeptIsdeleted;
       this.clientDeptCreateDate = clientDeptCreateDate;
       this.clientDeptCreateBy = clientDeptCreateBy;
       this.rmsUsers = rmsUsers;
       this.rmsProducts = rmsProducts;
    }
   
     @Id @GeneratedValue(strategy=IDENTITY)
    
    @Column(name="CLIENT_DEPT_ID", unique=true, nullable=false)
    public Integer getClientDeptId() {
        return this.clientDeptId;
    }
    
    public void setClientDeptId(Integer clientDeptId) {
        this.clientDeptId = clientDeptId;
    }
@ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="CLIENT_ID", nullable=false)
    public RmsClient getRmsClient() {
        return this.rmsClient;
    }
    
    public void setRmsClient(RmsClient rmsClient) {
        this.rmsClient = rmsClient;
    }
    
    @Column(name="CLIENT_DEPT_CODE", nullable=false, length=10)
    public String getClientDeptCode() {
        return this.clientDeptCode;
    }
    
    public void setClientDeptCode(String clientDeptCode) {
        this.clientDeptCode = clientDeptCode;
    }
    
    @Column(name="CLIENT_DEPT_NAME", nullable=false, length=50)
    public String getClientDeptName() {
        return this.clientDeptName;
    }
    
    public void setClientDeptName(String clientDeptName) {
        this.clientDeptName = clientDeptName;
    }
    
    @Column(name="CLIENT_DEPT_ISACTIVE", nullable=false)
    public boolean isClientDeptIsactive() {
        return this.clientDeptIsactive;
    }
    
    public void setClientDeptIsactive(boolean clientDeptIsactive) {
        this.clientDeptIsactive = clientDeptIsactive;
    }
    
    @Column(name="CLIENT_DEPT_ISDELETED", nullable=false)
    public boolean isClientDeptIsdeleted() {
        return this.clientDeptIsdeleted;
    }
    
    public void setClientDeptIsdeleted(boolean clientDeptIsdeleted) {
        this.clientDeptIsdeleted = clientDeptIsdeleted;
    }
    @Temporal(TemporalType.TIMESTAMP)
    @Column(name="CLIENT_DEPT_CREATE_DATE", nullable=false, length=19)
    public Date getClientDeptCreateDate() {
        return this.clientDeptCreateDate;
    }
    
    public void setClientDeptCreateDate(Date clientDeptCreateDate) {
        this.clientDeptCreateDate = clientDeptCreateDate;
    }
    
    @Column(name="CLIENT_DEPT_CREATE_BY", nullable=false)
    public int getClientDeptCreateBy() {
        return this.clientDeptCreateBy;
    }
    
    public void setClientDeptCreateBy(int clientDeptCreateBy) {
        this.clientDeptCreateBy = clientDeptCreateBy;
    }
@OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY, mappedBy="rmsClientDept")
    public Set<RmsUser> getRmsUsers() {
        return this.rmsUsers;
    }
    
    public void setRmsUsers(Set<RmsUser> rmsUsers) {
        this.rmsUsers = rmsUsers;
    }
@OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY, mappedBy="rmsClientDept")
    public Set<RmsProduct> getRmsProducts() {
        return this.rmsProducts;
    }
    
    public void setRmsProducts(Set<RmsProduct> rmsProducts) {
        this.rmsProducts = rmsProducts;
    }




}


